import axios from 'axios'

export function getDishList(restaurantId) {
  return axios.get(`/restaurant/${restaurantId}/dishes`)
}

export function getDishDetail(id) {
  return axios.get(`/dish/${id}`)
}

// 管理端接口
export function createDish(data) {
  return axios.post('/admin/dish', data)
}

export function updateDish(id, data) {
  return axios.put(`/admin/dish/${id}`, data)
}

export function deleteDish(id) {
  return axios.delete(`/admin/dish/${id}`)
}

export function getAdminDishes(restaurantId) {
  return axios.get('/admin/dish', { params: { restaurantId } })
}

export function updateDishStatus(id, status) {
  return axios.put(`/admin/dish/${id}/status`, { status })
}

